import QtQuick 2.12
import QtQuick.Window 2.12

Window {
    visible: true
//    width: background.width     // 绑定，不是赋值（=）
//    height: background.height
    width: 640
    height: 400
    title: qsTr("小风车转啊")

    Image {                      //topmost的先绘制
        anchors.fill: parent;  //用当前元素填充parent
        id: background      //id不能修改，相当于C++的引用
        source: "../images/2.png"   //url  相对路径
    }
    Image {
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        id: pole
        source: "../images/3.png"
    }
    Image {
        id: wheel
        width: 100
        height: 100
        anchors.bottom: pole.top
        anchors.horizontalCenter: parent.horizontalCenter
        source: "../images/1.png"

        Behavior on rotation {      //为特定的属性修改行为提供动画
            NumberAnimation{
                duration: 500
            }
        }

    }
    MouseArea{
        anchors.fill: parent
        onClicked:wheel.rotation +=360
    }
}
